#ifndef SALESMANCHROMOSOME_H_
#define SALESMANCHROMOSOME_H_

#include <QList>
#include <QMetaType>

#include "IntegerChromosome.h"

/**
  * Class that represents chromosome salesman data
  * Contains chromosome bits, fitness and methods to cross over and mutate.
  * @author Łukasz Szybka
  */
class SalesmanChromosome : public IntegerChromosome
{
public:
    /**
      * Constructor
      */
    SalesmanChromosome();
	
    /**
      * Constructor
      * @param size Lenght of chromosome
      */
    SalesmanChromosome(int size);

    SalesmanChromosome(int _min, int _max);

    void setData(QList<int> _numberList);
	
    /**
      * Copy constructor
      * @param other SalesmanChromosome to copy
      */
    SalesmanChromosome(const SalesmanChromosome &other);
    /**
      * Destructor
      */
    ~SalesmanChromosome();

    SalesmanChromosome& operator=(const SalesmanChromosome& other);

    void setRandom();
    void crossOver(const Chromosome& partner);
    void mutate(int index);

    Chromosome* duplicate() const;

protected:

private:

};

Q_DECLARE_METATYPE(SalesmanChromosome);

#endif /*SALESMANCHROMOSOME_H_*/
